//
//  commodityData.m
//  JiZhuiAn
//
//  Created by Easy.Lin on 16/7/14.
//  Copyright © 2016年 Easy. All rights reserved.
//

#import "commodityData.h"

@implementation commodityData

- (instancetype)initFromBmobObject:(BmobObject *)obj
{
    self = [super initFromBmobObject:obj];
    if (self) {
        BmobFile * imageFile = [obj objectForKey:@"commodityImageFile"];
        self.commodityImageURL = imageFile.url;
        self.commodityName = [obj objectForKey:@"name"];
        self.commodityPrice = [NSString stringWithFormat:@"%.2f元",[[obj objectForKey:@"price"] floatValue]];
        self.commodityGoodPercent = [[obj objectForKey:@"rateOfPraise"] floatValue];
        self.commoditySalesNumber = [[obj objectForKey:@"salesNumber"] integerValue];
    }
    return self;
}

@end
